import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      meta:{name: '登录'},
      component: () => import('@/views/Login.vue'),
    },
    {
      path:'/manager',
      component: () => import('@/views/Manager.vue'),
      children: [
        { path: 'admin', meta:{name: '管理员信息'}, component: () => import('@/views/Admin.vue') },
        { path: 'home', meta:{name: '首页'}, component: () => import('@/views/Home.vue') },
        { path: 'user', meta:{name: '普通用户信息'}, component: () => import('@/views/User.vue') },
        { path: 'drugClassification', meta:{name: '药品分类'}, component: () => import('@/views/DrugClassification.vue') },
        { path: 'drugDetails', meta:{name: '药品详情'}, component: () => import('@/views/DrugDetails.vue') },
        { path: 'order', meta:{name: '订单明细'}, component: () => import('@/views/Order.vue') },
        { path: 'person', meta:{name: '个人信息'}, component: () => import('@/views/Person.vue') },
        { path: 'updatePassword', meta:{name: '修改密码'}, component: () => import('@/views/UpdatePassword.vue') }
      ],
      redirect: '/manager/home'
    }
  ],
})

export default router
